<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${basePath}/js/jquery.js"></script>
</head>
<script>
window.onload=function(){
	$("#open").click(function() {
		$(".tip").fadeIn(200);
	});
	
	$(".tiptop a").click(function() {
		$(".tip").fadeOut(200);
	});

	$(".sure").click(function() {
		$(".tip").fadeOut(100);
	});

	$(".cancel").click(function() {
		$(".tip").fadeOut(100);
	});
var role = "${role}";
if(role=="超级管理员"){
	var title = $("#supermanage");
	title.show();
}
if(role=="管理员"){
	var title = $("#manage");
	title.show();
}
if(role=="营销部"){
	var title = $("#sell");
	title.show();
}
if(role=="商品管理员"){
	var title = $("#product");
	title.show();
}
//定时器每秒调用一次fnDate()
setInterval(function(){
fnDate();
},1000);
}
//js 获取当前时间
function fnDate(){
var oDiv=document.getElementById("div1");
var date=new Date();
var year=date.getFullYear();//当前年份
var month=date.getMonth();//当前月份
var data=date.getDate();//天
var hours=date.getHours();//小时
var minute=date.getMinutes();//分
var second=date.getSeconds();//秒
var time=year+"年"+fnW((month+1))+"月"+fnW(data)+"日"+fnW(hours)+":"+fnW(minute)+":"+fnW(second);
oDiv.innerHTML=time;
}
//补位 当某个字段不是两位数时补0
function fnW(str){
var num;
str>10?num=str:num="0"+str;
return num;
} 
</script>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    </ul>
    </div>
    
    <div class="mainindex">
    
    
    <div class="welinfo">
    <span><img src="images/sun.png" alt="天气" /></span>
    <b>${name}先生！你好，欢迎使用信息管理系统</b>
    </div>
    
    <div class="welinfo">
    <span><img src="images/time.png" alt="时间" /></span>
    <i><span>现在的时间为：</span><span id="div1"></span>
    </div>
    
    <div class="xline"></div>
    <div class="box"></div>
    
    <div class="welinfo">
    <span><img src="images/dp.png" alt="提醒" /></span>
    <b>你的管理权限为：</b>${role}<b>你可以完成以下功能</b>
    </div>
    
    <ul class="infolist" id="supermanage" style="display:none">
    <li><span>你是超级管理员了！我就不说太多了！</span><a class="ibtn">为所欲也</a></li>
    </ul>
    
    <ul class="infolist" id="manage" style="display:none">
    <li><span>商品及相关管理</span><a class="ibtn" href="${basePath}/product/list?page=1">查看商品列表</a></li>
    <li><span>订单管理</span><a class="ibtn" href="${basePath}/order/list?page=1">查看订单列表</a></li>
    <li><span>查看报表</span><a class="ibtn" href="category_report.jsp">查看报表</a></li>
    </ul>
    
    <ul class="infolist" id="sell" style="display:none">
    <li><span>快去管理你的订单，订单管理！</span><a class="ibtn" href="${basePath}/order/list?page=1">订单管理</a></li>
    </ul>
    
    <ul class="infolist" id="product" style="display:none">
    <li><span>我要管理轮播图！</span><a class="ibtn" href="${basePath}/banner/list">轮播图管理</a></li>
    <li><span>我要专题商品！</span><a class="ibtn" href="${basePath}/theme/list">专题管理</a></li>
    <li><span>我要分类商品！</span><a class="ibtn" href="${basePath}/category/list">分类管理</a></li>
    <li><span>我要商品列表！</span><a class="ibtn" href="${basePath}/product/list?page=1">商品管理</a></li>
    </ul>
    
    <div class="xline"></div>
    
    
    <div class="tip">
			<div class="tiptop">
				<span>发布公告</span><a></a>
			</div>

			<form id="mainFrom" method="post" action="${basePath}/note/inser" class="basic-grey" enctype="multipart/form-data">
				<h1>
					发布公告<span>你可以从这里发布一条公告（公告在不覆盖的情况下，最多保存2天）</span>
				</h1>
				<div style="text-align:center">
				<textarea rows="4" cols="30" name="text">
				
				</textarea>
				</div>
				<div class="tipbtn">
					<input name="" type="submit" class="sure" value="发布" />&nbsp; <input
						name="" type="button" class="cancel" value="取消" />
				</div>
			</form>
		</div>

</body>

</html>
